import java.util.ArrayList;
import java.util.Date;


public class ReverseSolverStarter extends Thread{
	
	private String solution;
	private PlayerNBoxesReverse pnb;
	private Board b;
	public ReverseSolverStarter(Board board, PlayerNBoxesReverse pnb) {
		solution= "";
		this.pnb = pnb;
		this.b = board;
	}
	
	public String getSolution(){
		return solution;
	}
	
	public void run(){
		try{
		   long start; 
           start=new Date().getTime();
           
           ArrayList<Move> movesToDo = new ArrayList<Move>();
           Retrace rtr = new Retrace(b,pnb);
           movesToDo = rtr.retraceInterface();
         
           solution = Assist.manWay(b, pnb, movesToDo);
           System.out.println("Reverse Solver -> solution: "+solution);
           long end= ((new  Date().getTime())-start);
           System.out.println("in: "+end+"ms = "+end/1000+"s = "+end/1000/60.+"min = "+end/1000/60/60.0+"h");
           
		}	catch(Throwable t){
			t.printStackTrace();
		}
		
		
	}
	

}
